package com.llsydn.service.remote;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.util.Log;

/**
 * @author lilinshen
 * @title 远程服务service
 * @description 请填写相关描述
 * @date 2018/9/29 11:10
 */
public class RemoteService extends Service {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.e("TAG", "onBind()");
        return new StudentService();
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.e("TAG", "onUnbind()");
        return super.onUnbind(intent);
    }

    //处理Student相关的业务逻辑类
    class StudentService extends IStudentService.Stub {
        @Override
        public Student getStudentById(int id) throws RemoteException {
            Log.e("TAG", "Service getStudentById()" + id);
            return new Student(id, "Tom", 10000);
        }
    }

}
